package com.gm.wholesale.module.main.presenter

import com.gm.commonlib.views.popupwindow.Popupwindow
import com.gm.wholesale.module.main.ui.MainActivity
import com.gm.wholesale.module.order.view.VoiceInputView

class VoiceViewPresenter {
    private var mVoiceInputView: VoiceInputView? = null
    var activity: MainActivity? = null
    fun showView(mActivity: MainActivity?) {
        activity = mActivity
        if (mVoiceInputView == null) {
            mVoiceInputView = VoiceInputView(mActivity)
        }
        mVoiceInputView?.reset()
        mVoiceInputView?.startVoice { _, _ ->
            Popupwindow.showPopCenterView(
                activity,
                mVoiceInputView
            )
        }
    }
}